<template>
	<view class="collections">
		<!-- #ifndef MP-ALIPAY -->
			<cu-custom bgColor="bg-gradual-blue" :isBack="true">
				<block slot="backText">返回</block>
				<block slot="content">收藏列表</block>
			</cu-custom>
		<!-- #endif -->
		<view class="cu-list menu-avatar">
			<view class="cu-item" v-for="item in lists" :key="item.id">
				<view class="cu-avatar radius lg" :style="{'background-image':'url('+item.author.avatar_url+')'}"></view>
				<view class="content">
					<view class="text-grey">{{item.author.loginname}}</view>
					<view class="text-gray text-sm flex">
						<view class="text-cut">
							{{item.title}}
						</view>
					</view>
				</view>
				<view class="action">
					<view class="text-grey text-xs">{{item.last_reply_at|handlTime}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:'meetgyp',
				lists: []
			};
		},
		methods: {
			async getCollect() {
				const res = await this.$api.getCollect(this.user)
				this.lists = res
			}
		},
		onLoad(options) {
			this.user = options.user
			this.getCollect()
		}
	}
</script>

<style lang="scss">

</style>
